﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;

namespace DataModels.Models
{
    public partial class LDForm_TaarifaYaWaliojifungua : MTUHAReportBase
    {
        private int _C_2a;
        public int C_2a
        {
            get { return _C_2a; }
            set
            {
                _C_2a = value;
                OnPropertyChanged("C_2a");
                C_2e = _C_2a + +_C_2b + _C_2c + _C_2d;
                OnPropertyChanged("C_2g");
            }
        }

        private int _C_2b;
        public int C_2b
        {
            get { return _C_2b; }
            set
            {
                _C_2b = value;
                OnPropertyChanged("C_2b");
                C_2e = _C_2a + +_C_2b + _C_2c + _C_2d;
            }
        }

        private int _C_2c;
        public int C_2c
        {
            get { return _C_2c; }
            set
            {
                _C_2c = value;
                OnPropertyChanged("C_2c");
                C_2e = _C_2a + +_C_2b + _C_2c + _C_2d;
            }
        }

        private int _C_2d;
        public int C_2d
        {
            get { return _C_2d; }
            set
            {
                _C_2d = value;
                OnPropertyChanged("C_2d");
                C_2e = _C_2a + +_C_2b + _C_2c + _C_2d;
            }
        }

        private int _C_2e;
        public int C_2e
        {
            get { return _C_2e; }
            set
            {
                _C_2e = value;
                OnPropertyChanged("C_2e");
            }
        }

        private int _C_2f;
        public int C_2f
        {
            get { return _C_2f; }
            set
            {
                _C_2f = value;
                OnPropertyChanged("C_2f");
            }
        }

        private int _C_2g;
        public int C_2g
        {
            get 
            {
                if (_External_WaliotarajiwaKujifungua > 0)
                {
                    decimal num = _C_2a;
                    decimal den = _External_WaliotarajiwaKujifungua;
                    decimal percentage = (num / den) * 100;
                    _C_2g = (int)percentage;
                }
                else _C_2g = 0;
                return _C_2g; 
            }
            set
            {
                _C_2g = value;
                OnPropertyChanged("C_2g");
            }
        }

        public virtual List<LDForm> LDForms { get; set; }

        private int _External_WaliotarajiwaKujifungua;
        [NotMapped]
        public int External_WaliotarajiwaKujifungua
        {
            set 
            { 
                _External_WaliotarajiwaKujifungua = value;
                OnPropertyChanged("External_WaliotarajiwaKujifungua");
                OnPropertyChanged("C_2g");
            }
        }
    }
}
